package router

import (
    "gitee.com/zwx784533/zwx2018/controller/user"
    "gitee.com/zwx784533/zwx2018/app"
    "gitee.com/zwx784533/zwx2018/middleware"
    "gitee.com/zwx784533/zwx2018/controller/userFriend"
)

func Routes(r *app.Router)  {
    r.Group("/api", func() {
        r.POST("/login", user.Login)
        r.POST("/register", user.Register)
        r.GET("/user/:id", user.GetUserPublicInfo)
    }, middleware.GlobalHandle)

    r.Group("/my", func() {
        r.GET("/profile", user.GetUserInfo)
        r.PUT("/profile", user.UpdateProfile)
        r.GET("/cos-signature", user.GetQcloudSignature)
        r.POST("/add-friend", userFriend.AddFriend)
    }, middleware.LoginHandle)
}
